
from flask import Flask
from dataclasses import dataclass, asdict

app = Flask(__name__)

@app.route("/")
def hello_world():
    return "<p>Hello, World!</p>"

@dataclass
class User:
    username: str
    email: str

users = [
    User("madengyun", "madengyun@gmail.com"),
    User("johndoe", "johndoe@gmail.com")
]

@app.route("/users")
def get_users():
    users_dict = [asdict(user) for user in users]
    return users_dict

@app.route("/me")
def me():
    return {
        "username" : "madengyun",
        "email" : "madengyun@gmail.com"
    }

if __name__ == "__main__":
    app.run(debug=True, host="0.0.0.0")